package com.awb.rabbitmqdemo.simple;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SimpleConsumer {

    @Autowired
    private RabbitTemplate rabbitTemplate;
    
    
    @RabbitHandler
    @RabbitListener(queuesToDeclare = @Queue("simple_queue"))
    public  void  process(String message){
        System.out.println("简单模式接收消息："+message);
    }
}
